var key = new Object("key","#FFF","#090",keyAction,keyDraw);

function keyAction(x,y,direction)
{
	window.game.keysToGo = window.game.keysToGo - 1 ;
	window.game.table[x][y]=0;
	return true;
}

function keyDraw(context,x,y,width,height)
{
	context.strokeStyle="#000";
	context.fillStyle="#000";
	context.lineWidth=height/10;
	context.beginPath();
	context.arc(x+width*.2,y+height*.5,height/5,0,Math.PI*2);
	context.fill();
	context.beginPath();
	context.moveTo(x+width*.2,y+height*.5);
	context.lineTo(x+width*.7,y+height*.5);
	context.lineTo(x+width*.7,y+height*.6);
	context.moveTo(x+width*.7,y+height*.5);
	context.lineTo(x+width*.8,y+height*.5);
	context.lineTo(x+width*.8,y+height*.7);
	context.lineTo(x+width*.8,y+height*.5);
	context.lineTo(x+width*.9,y+height*.5);
	context.lineTo(x+width*.9,y+height*.8);
	context.stroke();
}

window.game.addObject( key );